package chapter22;

public class Node {
    public static int WHILE = 0;
    public static int GRAY = 1;
    public static int BLACK = 2;

    public int color;
    public int d;
    public Node p;
    public Node next;
    public int key;
    public int f;

    public Node(int color, int d, Node p, Node next, int key) {
        this.color = color;
        this.d = d;
        this.p = p;
        this.next = next;
        this.key = key;
    }

    public Node(int key) {
        this.color = WHILE;
        this.d = 0;
        this.p = null;
        this.next = null;
        this.key = key;
    }

    public Node() {
    }

    @Override
    public String toString() {
        return "Node{" +
                "color=" + color +
                ", d=" + d +
                ", p=" + p +
                ", key=" + key +
                ", f=" + f +
                '}';
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public int getD() {
        return d;
    }

    public void setD(int d) {
        this.d = d;
    }

    public Node getP() {
        return p;
    }

    public void setP(Node p) {
        this.p = p;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public int getF() {
        return f;
    }

    public void setF(int f) {
        this.f = f;
    }
}
